﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pahan.McuFusion.IO
{
    internal interface IParallelPortImpl
    {
        /// <summary>
        /// Opens the port.
        /// </summary>
        void Open();

        /// <summary>
        /// Closes the port.
        /// </summary>
        void Close();

        /// <summary>
        /// Gets the value indicating whether the port is opened.
        /// </summary>
        bool IsOpened
        {
            get;
        }

        /// <summary>
        /// Gets or sets the base address.
        /// </summary>
        ushort BaseAddress
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the value of data i/o port.
        /// </summary>
        byte DataPort
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the value of control i/o port.
        /// </summary>
        byte ControlPort
        {
            get;
            set;
        }

        /// <summary>
        /// Gets the value of status i/o port.
        /// </summary>
        byte StatusPort
        {
            get;
        }

        /// <summary>
        /// Reads the value from the specified pin.
        /// </summary>
        bool ReadPin(ParallelPortPins pin);

        /// <summary>
        /// Writes the value to the specified pin.
        /// </summary>
        void WritePin(ParallelPortPins pin, bool value);
    }
}
